<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>阿呆社区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{/css/ardai.css}">
    <link rel="shortcut icon" th:href="@{img/上线测试10}">
    <script th:src="@{/js/jquery-3.4.1.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">阿呆社区</span>
            </button>
            <a class="navbar-brand" th:href="@{/list}">Ardai</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <form class="navbar-form navbar-left" method="get" id="search" th:action="@{/search}">
                <div class="form-group">
                    <input type="text" name="title" class="form-control" placeholder="帖子名..">
                </div>
                <button type="submit" class="btn btn-default">搜索问题</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li th:if="${session.user==null}"><a th:href="@{/toLogin}">登陆</a></li>
                <li th:if="${session.user!=null}" class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img th:src="@{${session.user.avatar}}" style="width: 40px;border-radius: 50%"/> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">消息中心</a></li>
                        <li><a th:href="@{/toAddPost}">发布帖子</a></li>
                        <li><a th:href="@{/userInfo(uid=${session.user.id})}">个人资料</a></li>
                        <li><a th:href="@{/logout}">退出登陆</a></li>
                        <li><a th:if="${session.user.owner==0}" th:href="@{/admFindPost}">后台管理</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h3><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 发现</h3>
            <ul class="nav nav-tabs">
                <li th:each="type:${types}" role="presentation">
                    <a th:text="${type.name}" th:href="@{/type(tid=${type.id})}">最新</a>
                </li>
            </ul>

            <div th:each="post:${pageInfo.postList}" class="media">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-rounded"
                             th:src="@{${post.userAvatar}}" style="width: 70px;">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading">
                        <a th:text="${post.title}" th:href="@{/post(pid=${post.id})}">xxxx</a>
                    </h4>
                    <span class="text-desc"><span th:text="${post.comments}" >0</span> 个评论 • <span th:text="${post.view}">6</span> 次浏览 • <span th:text="${#dates.format(post.createTime,'yyyy-MM-dd HH:mm')}">2020-12-13 21:49</span></span>
                </div>
            </div>
<!--            <div  class="media">-->
<!--                <div class="media-left">-->
<!--                    <a href="#">-->
<!--                        <img class="media-object img-rounded"-->
<!--                             th:src="@{/img/avatar.png}" style="width: 70px;">-->
<!--                    </a>-->
<!--                </div>-->
<!--                <div class="media-body">-->
<!--                    <h4 class="media-heading">-->
<!--                        <a  href="###">ceshi</a>-->
<!--                    </h4>-->
<!--                    <span class="text-desc"><span >0</span> 个回复 • <span >6</span> 次浏览 • <span>2020-12-13 21:49</span></span>-->
<!--                </div>-->
<!--            </div>-->


            <nav th:if="${status==0}" aria-label="Page navigation">
                <ul class="pagination">

                    <li th:class="${page==pageInfo.page}?'active':''" th:each="page:${pageInfo.pageList}">
                        <a th:text="${page}" th:href="@{/list(page=${page})}">page</a>
                    </li>
                    <li>
                        <a th:href="@{/list(page=${pageInfo.page+1})}"
                           aria-label="Previous">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
<!--                    <li>-->
<!--                        <a href="/?page=126&amp;search=&amp;tag=&amp;sort="-->
<!--                           aria-label="Previous">-->
<!--                            <span aria-hidden="true">&gt;&gt;</span>-->
<!--                        </a>-->
<!--                    </li>-->
                </ul>
            </nav>
            <nav th:if="${status==1}" aria-label="Page navigation">
                <ul class="pagination">

                    <li th:class="${page==pageInfo.page}?'active':''" th:each="page:${pageInfo.pageList}">
                        <a th:text="${page}" th:href="@{/type(page=${page},tid=${pageInfo.other})}">page</a>
                    </li>
                    <li>
                        <a th:href="@{/type(page=${pageInfo.page+1},tid=${pageInfo.other})}"
                           aria-label="Previous">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <!--                    <li>-->
                    <!--                        <a href="/?page=126&amp;search=&amp;tag=&amp;sort="-->
                    <!--                           aria-label="Previous">-->
                    <!--                            <span aria-hidden="true">&gt;&gt;</span>-->
                    <!--                        </a>-->
                    <!--                    </li>-->
                </ul>
            </nav>
            <nav th:if="${status==2}" aria-label="Page navigation">
                <ul class="pagination">

                    <li th:class="${page==pageInfo.page}?'active':''" th:each="page:${pageInfo.pageList}">
                        <a th:text="${page}" th:href="@{/search(page=${page},title=${pageInfo.other})}">page</a>
                    </li>
                    <li>
                        <a th:href="@{/search(page=${pageInfo.page+1},title=${pageInfo.other})}"
                           aria-label="Previous">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <!--                    <li>-->
                    <!--                        <a href="/?page=126&amp;search=&amp;tag=&amp;sort="-->
                    <!--                           aria-label="Previous">-->
                    <!--                            <span aria-hidden="true">&gt;&gt;</span>-->
                    <!--                        </a>-->
                    <!--                    </li>-->
                </ul>
            </nav>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div><div>
                <!--我的微信-->
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 side">
                    <h4>登陆后发帖...</h4>
                    <img class="" style="width: 300px;height: 300px" th:src="@{/img/lookbook.jpg}">
                </div>
            </div></div>
            <!--相关问题-->
            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>热门标签</h4>
                <button th:each="tag:${tags}" th:text="${tag.name}" type="button" class="btn btn-info">Java</button>
            </div>
            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>友情链接</h4>
                <p>我们班长CSDN: <br> <a href="https://blog.csdn.net/hanhanwanghaha" target="_blank"> https://blog.csdn.net/hanhanwanghaha</a></p>
                <p>我的GitHub: <br> <a href="https://github.com/a1207699139?tab=repositories"  target="_blank"> https://github.com/a1207699139?tab=repositories</a></p>
            </div>
            <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h4>学习网站推荐</h4>
                <p>bilbil(首推): <br> <a href="https://www.bilibili.com/" target="_blank"> https://www.bilibili.com/</a></p>
                <p>慕课网: <br> <a href="https://www.imooc.com/"  target="_blank"> https://www.imooc.com/</a></p>
                <p>菜鸟教程: <br> <a href="https://www.runoob.com/"  target="_blank"> https://www.runoob.com/</a></p>
                <p>github: <br> <a href="https://github.com/"  target="_blank"> https://github.com/</a></p>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script>
    document.getElementById("search").onclick=function () {
        document.getElementById("search").value='';
    }
</script>